extends layout

block content
	div.container
		h3 Submits for #{title}

		ul(class="nav nav-tabs")
			li(role="presentation")
				a(href="/") Course Page
			li(role="presentation")
				a(href="/home") My Home Page
			li(role="presentation" class="navbar-right")
				a(href="/signout") Signout
		br
		if !submits
			p you have no submit for this homework
		each item in submits
			div.ui.piled.segment
				h2 <b>#{item.title}</b>
				div !{item.description}
					br
					p 作者: #{item.author}
					p 提交时间: <code>#{item.submitDate}</code>
					if item.grade
						p 分数: <code>#{item.grade}</code>
					else
						p 分数: <code>未给出分数</code>
					if user.type == 'teacher'
						if overtime
							p <b>还未到达截止日期, 不能给出分数</b>
							form(method="post" action="/grades/#{item.author}/#{title}" )
								input(type="text" name="grade" required disabled)
								&nbsp;&nbsp;&nbsp;&nbsp;
								button.ui.button.positive.disabled(type="submit" disabled) give a grade
						else
							form(method="post" action="/grades/#{item.author}/#{title}")
								input(type="text" name="grade" required)
								&nbsp;&nbsp;&nbsp;&nbsp;
								button.ui.button.positive(type="submit") give a grade
			br